# coding=gbk

from DataAccess.DBConnFactory import DBConnFactory
from Recover.PositionRecover import *
from Config.ImportConfig import *
from Common.DayCounter import *

from Import.TradeImport import *
from Import.PositionImport import *

from Mark2Mkt.CalcPnL import *
from Position.CalcDailyPosition import *

from testscript.case import *
from testscript.case2 import *
from testscript.case3 import *
from testscript.case4 import *
from testscript.case5 import *
from testscript.case_report import *
from testscript.case_us_sec_import import *
from testscript.case_acct1 import *
from testscript.case_routine import *
from testscript.case_CHOPP import *
from testscript.case_dom import *

from Routine.UpdateFX import *
from Routine.UpdateStockStatic import update_stock_static_info_from_vendor
from Routine.UpdateStockPrice import *

from Reporting.TradeReport import *
from Reporting.PnLReport import *

from Accounting.Routine.OpenDayOp import *
from Accounting.Routine.Settle import *

from datetime import date, timedelta
import timeit
import csv

			
def run_dom():
	start_date = date(2011, 1, 27)
	#start_date = date(2010, 7, 5)
	clear_all_record_after(start_date)	
	#incepition_setup_DOMFUND()
	run_DOMFUND(start_date)
	m2m_DOMFUND(start_date)

	
def run_CH_OPP():
	clear_before_inception()
	incepition_setup_CHOPP()
	
	start_date = date(2007, 9, 11)
	#start_date = date(2010, 7, 15)
	#clear_all_record_after_CHOPP(start_date)
	run_CHOPP(start_date)
	
			
if __name__ == '__main__':
	run_CH_OPP()
	#m2m_CHOPP()
	
	